package com.csdj.dao.impl;

import com.csdj.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

@Repository
public class UserDaoImpl  implements UserDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public int getUserCount() {
        String sql = "select count(1) from users";
        return this.jdbcTemplate.queryForObject(sql,Integer.class);
    }
}
